package com.ruoyi.facilityInfo.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum Type {

    WATER("1","饮水机"),
    BORROW("2","自助借还机"),
    READ("3","电子阅览室");

    private final String num;
    private final String name;

    public static void changeTotype(FacilityInfo facilityInfo) {
        for (Type type : Type.values()) {
            if (facilityInfo.getFacilityType().equals(type.getNum())) {
                facilityInfo.setFacilityType(type.getName());
            }
        }
    }
    public static void changeTonum(FacilityInfo facilityInfo) {
        for (Type type : Type.values()) {
            if (facilityInfo.getFacilityType().equals(type.getName())) {
                facilityInfo.setFacilityType(type.getNum());
            }
        }
    }
}
